//
//  NSString+HHPath.m
//  Addition
//
//  Created by 花花 on 2017/1/17.
//  Copyright © 2017年 花花. All rights reserved.
//

#import "NSString+HHPath.h"

@implementation NSString (HHPath)

//g给当前文件追加文档路径
- (NSString *)appendDocumentDir{
    NSString *dir = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES).lastObject;
    
    return [dir stringByAppendingPathComponent:self.lastPathComponent];
    
}

//给当前文件追加缓存路径
- (NSString *)appendCacheDir{
    NSString *dir = NSSearchPathForDirectoriesInDomains(NSCachesDirectory, NSUserDomainMask, YES).lastObject;
    
    return [dir stringByAppendingPathComponent:self.lastPathComponent];
    
    
}

/// 给当前文件追加临时路径
-(NSString *)appendTempDir{
    NSString *dir = NSTemporaryDirectory();
    
    return [dir stringByAppendingPathComponent:self.lastPathComponent];
    
}
@end
